﻿@model WebVideo.Areas.Admin.Models.BusinessModel       
@{
    ViewBag.Title = "Insert";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

<script src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery-1.7.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery-ui-1.8.16.custom.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/cssAdmin/ckeditor/ckeditor.js")" type="text/javascript"></script>

<script type="text/javascript">
    jQuery(document).ready(function () {
        $('#nofSuccess').hide(); // an thong bao
        $('#nofError').hide();
        $('#errorlist').hide();
        readyValue();
    });
    function alertMsg(msg) {
        $('#nofSuccess').hide();
        $('#nofError').show();
        $('#msgNofError').text(msg);
    }

    function Checkdk() {

        var Username = $('#Username').val();
        var Email = $('#Email').val();

        var postURL = '@Url.Action("Checkdk", "LoginUser")';
        alert(data.dkch);
          //         $.post("/Admin/Login/CheckId", { "Username": Username, "Pass": Pass }, function (data) {
        $.post(postURL, { "Username": Username, "Email": Email }, function (data) {
            alert(data.dkch);
            if (data.dkch == 1) {
                alert("Tên đăng nhập đã tồn tại");
            }
            else if (data.dkch == 2) {
                alert("Email đã được đăng ký");
            }
        });
    };
</script>


<div class="maincontentinner">
    <ul class="maintabmenu">
        <li class="current"><a href="@Url.Action("Index", "Business")" >Index</a></li>
        <li class="current"><a href="@Url.Action("Insert", "Business")" >Insert</a></li>
        
    </ul>
    <!--maintabmenu-->
    <div class="notification msgsuccess" style="display: none" id="nofSuccess">
        <a class="close"></a>
        <p id="msgNofSuccess">This is a success message.</p>
    </div>
    <!-- notification msgsuccess -->
    <div class="notification msgerror" style="display: none" id="nofError">
        <a class="close"></a>
        <p id="msgNofError">This is an error message.</p>
    </div>
    <!-- notification msgerror -->
    <div class="contenttitle radiusbottom0">
        <h2 class="table"><span>Insert  MultipleChoice Questions</span></h2>
    </div>
    <!--contenttitle-->
    @using (Html.BeginForm("Insert", "Business",
            new { ReturnUrl = ViewBag.ReturnUrl },
            FormMethod.Post, new { @class = "stdform stdform2", @enctype = "multipart/form-data" }))
    {                
        <p>
            <label>Username</label>
            <span class="field">
                @Html.EditorFor(model => model.UserName)
                @Html.ValidationMessageFor(model => model.UserName)
            </span>
        </p>
         <p>
            <label>Mật khẩu</label>
            <span class="field">
                 @Html.PasswordFor(model => model.Pass)
                @Html.ValidationMessageFor(model => model.Pass)
            </span>
        </p>
        <p>
            <label>Mật khẩu Nhập Lại</label>
            <span class="field">
                 @Html.PasswordFor(model => model.ConfirmPassword)
                @Html.ValidationMessageFor(model => model.ConfirmPassword)
            </span>
        </p>
     
        <p>
            <label>Tên doanh nghiệp</label>
            <span class="field">
                 @Html.EditorFor(model => model.CompanyName)
                @Html.ValidationMessageFor(model => model.CompanyName)
            </span>
        </p>
        <p>
            <label>Email</label>
            <span class="field">
                 @Html.EditorFor(model => model.Email)
                @Html.ValidationMessageFor(model => model.Email)
            </span>
        </p>
          <p>
            <label>Avatar</label>
            <span class="field">
                @Html.TextBoxFor(model => model.Avatar, new { type = "file" })
                @Html.ValidationMessageFor(model => model.Avatar)
            </span>
        </p>
         <p>
            <label>Fanpage</label>
            <span class="field">
                 @Html.EditorFor(model => model.LinkFanpage)
                @Html.ValidationMessageFor(model => model.LinkFanpage)
            </span>
        </p>
         <p>
            <label>Địa chỉ</label>
            <span class="field">
                 @Html.EditorFor(model => model.Address)
                @Html.ValidationMessageFor(model => model.Address)
            </span>
        </p>
         <p>
            <label>Số điện thoại</label>
            <span class="field">
                 @Html.EditorFor(model => model.PhoneNumber)
                @Html.ValidationMessageFor(model => model.PhoneNumber)
            </span>
        </p>
         <p>
            <label>Fax</label>
            <span class="field">
                 @Html.EditorFor(model => model.Fax)
                @Html.ValidationMessageFor(model => model.Fax)
            </span>
        </p>
         <p>
            <label>Website</label>
            <span class="field">
                 @Html.EditorFor(model => model.Website)
                @Html.ValidationMessageFor(model => model.Website)
            </span>
        </p>
        <p class="stdformbutton">
            <input type="submit" value="Chấp nhận" />
            <input type="submit" value="Quay lại" onclick="javascript: history.back(); return false" />
        </p> 
    }
    <br clear="all" />
</div>
<!--maincontentinner-->

